package com.xinqi.common.third.oss;

import com.xinqi.common.third.oss.cloud.OssService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * OSS配置
 *
 * @author linkai
 * @date 2023/2/18
 */
@Configuration
@ConditionalOnProperty(prefix = "third.oss", name = {"type"})
@EnableConfigurationProperties(value = OssProperties.class)
public class OssConfig {

    @Bean()
    public OssService ossService(OssProperties ossProperties) {
        return OssFactory.build(ossProperties);
    }

}
